<template>
		<view class="assistance-price">
			<view class="price-box">
				<view class="price-list">
					<span class="price-title">销售金额</span>
					<span class="price-num">{{ price }}</span>
				</view>
				<view class="price-list">
					<span class="price-title">预计成交费用</span>
					<span class="price-num">{{ allPrice }}±30%</span>
				</view>
				<view class="price-list">
					<span class="price-title">最低投额</span>
					<span class="price-num">{{ allPrice }}</span>
				</view>
			</view>
			<view class="price-input">
				<span style="font-size: 28rpx;">投入金额：</span>
				<input type="number" placeholder="请输入投入金额" v-model="inputPrice"/>
				<span @tap="inputAll" style="width: 120rpx;
						height: 46rpx;
						background: #EC662F;
						border-radius: 24rpx;
						font-size: 28rpx;
						font-weight: 400;
						color: #FFFFFF;
						line-height: 46rpx;
						text-align: center;"
						>投入</span>
			</view>
		</view>
		
	
</template>

<script>
	export default {
		name:"AssistancePrice",
		props: {
			price:{
				type: String,
				default:' 0.00'
			},
			dealPrice:{
				type: String,
				default: '±30%'
			},
			allPrice:{
				type: String,
				default: '0.00'
			},
			goodsId:{
				type: Number,
				default: 0
			}
		},
		data(){
			return {
				inputPrice:'',
			}
		},
			
		methods:{
			async inputAll(){
				console.log('确认投入',this.goodsId,this.inputPrice);
				await uni.request({
					url: '/income/Apply/addorder',
					method: 'POST',
					data:{
						goods_id:this.goodsId,
						price:this.inputPrice
					},
					success: res => {
						this.$wanlshop.msg(res.msg)
					}
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.assistance-price{
		width: 688rpx;
		height: 170rpx;
		background: #F8F9FD;
		border-radius: 8rpx;
		    display: flex;
		    flex-direction: column;
		    align-items: center;
		    justify-content: space-around;
			.price-box{
				
			    display: flex;
			    flex-direction: row;
			   justify-content: space-between;
			        align-items: center;
			        width: 90%;
		.price-list{
			display: flex;
			    flex-direction: column;
			    align-items: center;
				.price-title{
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #676767;
					line-height: 34rpx;
					margin-bottom: 16rpx;
				}
				.price-num{
					font-size: 32rpx;
					font-family: DINAlternate-Bold, DINAlternate;
					font-weight: bold;
					color: #1C1C1C;
					line-height: 38rpx;
				}
		}
		}
		.price-input{
			    display: flex;
			    flex-direction: row;
			    align-items: center;
				 justify-content: space-between;
				 width: 90%;
				
		}
	}
</style>